//
//  indexCollectionViewCell.m
//  HuiWenMovie
//
//  Created by niceDay on 15/7/25.
//  Copyright (c) 2015年 computer. All rights reserved.
//

#import "indexCollectionViewCell.h"
#import "common.h"
#import "UIViewExt.h"
#import "UIImageView+WebCache.h"

@implementation indexCollectionViewCell

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self _createSubviews];
    }
    return self;
}

- (void)_createSubviews{
    CGFloat imageWidth = self.width*0.9;
    CGFloat imageHeight = self.height *0.9;
    
    _imageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.width-imageWidth)/2, (self.height-imageHeight)/2, imageWidth , imageHeight)];
    _imageView.hidden = NO;
    [self.contentView addSubview:_imageView];
    
    
}

-(void)setModal:(messageModal *)modal{
    _modal = modal;
    [self setNeedsLayout];
}




- (void)layoutSubviews{
    [super layoutSubviews];
    [_imageView sd_setImageWithURL:[NSURL URLWithString:_modal.images[@"large"]]];
}

@end
